// 新闻文章接口都在这里
import request from '../utils/request'

// 文章列表
export const getPostAPI = (params) => {
  return request({
    url: '/post',
    params
  })
}
//文章详情
export const getPostDetailstAPI = (id) => {
  return request({
    url: `/post/${id}`,
  })
}
//评论列表
export const postPommentAPI = (id,pageIndex,pageSize) => {
  return request({
    url: `/post_comment/${id}`,
    params:{
      pageIndex,pageSize
    }
  })
}
//搜索文章
export const postSearchAPI = (params) => {
  return request({
    method: 'GET',
    url: `/post_search`,
    params
  })
}
//发布文章
export const postAPI = (data) => {
  return request({ method: 'POST',url: '/post',data})
}
// 10. 编辑文章
export const updatePostAPI = (id, data) => {
  return request({
    method: 'POST',
    url: `/post_update/${id}`,
    data: data,
  })
}